package com.adou.d16.isr;

import java.io.*;

public class OSRTest1 {
    public static void main(String[] args) {
        try (
                // 1.创建字符流和源文件接通（GBK）
                OutputStream os = new FileOutputStream("d1-helloword-app\\src\\it07.txt");

                // 2.把原始字节输入流转成对应字符
                Writer osw = new OutputStreamWriter(os, "GBK");

                // 3.包装成缓冲字节流
                final BufferedWriter bw = new BufferedWriter(osw)
        ) {
            bw.write("我是中国人abc");
            bw.write("我是中国人123");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
